package com.globaldom.model;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.NotPersistent;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

//FIXME. Move all updates from civresource to here
//@Configurable
@PersistenceCapable
public class UpdateTimes implements Serializable {

	@NotPersistent
	private static final long serialVersionUID = 1L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String id;

	@Persistent
	private Integer updateType;
	@Persistent
	private Date resourceUpdate = new Date();
	@Persistent
	private Date milUpdate = new Date();
	@Persistent
	private Date locationUpdate = new Date();
	@Persistent
	private Date allyUpdate = new Date();
	@Persistent
	private Date researchUpdate = new Date();
	@Persistent
	private Date giftUpdate = new Date();

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Integer getUpdateType() {
		return updateType;
	}

	public void setUpdateType(Integer updateType) {
		this.updateType = updateType;
	}

	public Date getResourceUpdate() {
		return resourceUpdate;
	}

	public void setResourceUpdate(Date resourceUpdate) {
		this.resourceUpdate = resourceUpdate;
	}

	public Date getGiftUpdate() {
		return giftUpdate;
	}

	public void setGiftUpdate(Date giftUpdate) {
		this.giftUpdate = giftUpdate;
	}

	public Date getMilUpdate() {
		return milUpdate;
	}

	public void setMilUpdate(Date milUpdate) {
		this.milUpdate = milUpdate;
	}

	public Date getLocationUpdate() {
		return locationUpdate;
	}

	public void setLocationUpdate(Date locationUpdate) {
		this.locationUpdate = locationUpdate;
	}

	public Date getAllyUpdate() {
		return allyUpdate;
	}

	public void setAllyUpdate(Date allyUpdate) {
		this.allyUpdate = allyUpdate;
	}

	public Date getResearchUpdate() {
		return researchUpdate;
	}

	public void setResearchUpdate(Date researchUpdate) {
		this.researchUpdate = researchUpdate;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("Id: ").append(getId()).append(", ");
		return sb.toString();
	}

}
